package com.cd.hospital.modules.service.impl;

import com.xiaoleilu.hutool.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.cd.hospital.modules.dao.FriendLinkDao;
import com.cd.hospital.modules.entity.FriendLinkEntity;
import com.cd.hospital.modules.service.FriendLinkService;



@Service("friendLinkService")
public class FriendLinkServiceImpl implements FriendLinkService {
	@Autowired
	private FriendLinkDao friendLinkDao;
	
	@Override
	public FriendLinkEntity queryObject(Integer linkId){
		return friendLinkDao.queryObject(linkId);
	}
	
	@Override
	public List<FriendLinkEntity> queryList(Map<String, Object> map){
		return friendLinkDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return friendLinkDao.queryTotal(map);
	}
	
	@Override
	public void save(FriendLinkEntity friendLink){
		String now = DateUtil.now();
		friendLink.setCreateTime(DateUtil.parse(now));
		friendLink.setUpdateTime(DateUtil.parse(now));
		friendLinkDao.save(friendLink);
	}
	
	@Override
	public void update(FriendLinkEntity friendLink){
		String now = DateUtil.now();

		friendLink.setUpdateTime(DateUtil.parse(now));
		friendLinkDao.update(friendLink);
	}
	
	@Override
	public void delete(Integer linkId){
		friendLinkDao.delete(linkId);
	}
	
	@Override
	public void deleteBatch(Integer[] linkIds){
		friendLinkDao.deleteBatch(linkIds);
	}
	
}
